// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
import QtQuick 1.1
import com.nokia.symbian 1.1

Item {
    id: root

    Component.onCompleted: root.esconder();

    property int maximo : 0
    property alias indicador: indicadorProgresso

    function mostrar() {
        root.opacity = 1;
        root.visible = true
    }

    function esconder() {
        root.opacity = 0;
        root.visible = false;
    }

    function alterarValorProgresso(valor) {
        indicadorProgresso.value = valor;
    }

    Row {
        spacing: 5

        BusyIndicator  {
            id: busy
            running: root.visible
        }

        Column {
            Text {
                text: "Carregando..."
                font.pixelSize: 20
                color: platformStyle.colorNormalLight
            }
            ProgressBar {
                width: parent.width
                id: indicadorProgresso
                minimumValue: 0; maximumValue: root.maximo
                value: 0
            }            
        }
    }
}
